import Vue from 'vue';

//注册自定义指令
import '@common/directives';
import myMixin from '@common/mixins';
import ElementUI from 'element-ui';
import VueI18n from 'vue-i18n';
import { messages } from '@common/components/common/i18n';
import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
// import './assets/css/theme-green/index.css'; // 浅绿色主题
import '../assets/css/main.css';
import '../assets/css/color-dark.css'; /*深色主题*/
/*import "./assets/css/theme-green/color-green.css";   浅绿色主题*/
import '#/fonts/iconFont/iconFont.css';
import '#/fonts/fontAwesome/css/font-awesome.min.css';
import '../assets/css/icon.css';
import tableTemplate from "@common/components/BaseTable/index.vue";
import tableSetting from "@common/components/common/TableSetting";
import 'jquery';
import '#/plugins/ztree/ztree.core.js';
import '#/plugins/ztree/ztree.excheck.js';
import '#/plugins/ztree/ztree.exedit.js';
import '#/plugins/ztree/ztree.exhide.js';
import '#/plugins/ztree/metroStyle/metroStyle.css';
import iconPicker from 'vue-fontawesome-elementui-icon-picker';
import VTreeselect from 'vue-treeselect';
import TreeSelect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import FmMakingForm from 'form-making';
import 'form-making/dist/FormMaking.css';
import VueEditor from "vue2-editor";

import vEditor from "@common/components/common/vEditor.vue";

import NProgress from 'nprogress'; // nprogress插件
import 'nprogress/nprogress.css'; // nprogress样式

//打印插件
import Print from '#/plugins/print/print.js';

import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'

import ComponentDialog from "@common/components/dialog/component.vue";

//光速云打印插件
// import '@common/components/common/GSCloudPluginFuncs';

import '@common/components/MultiItemsInput';

import '@src/icons';
import SvgIcon from '@common/components/SvgIcon';
import RemoteSelect from '@common/components/custom/RemoteSelect';
import { hiPrintPlugin } from './hiprint';
// 百度地图
import BaiduMap from 'vue-baidu-map';
import GlobalValue from "./global";

// 简单配置
NProgress.inc(1);
NProgress.configure({ easing: 'ease', speed: 500, showSpinner: false });

Vue.use(GlobalValue);
Vue.use(BaiduMap, {
    // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */YOUR_APP_KEY
    ak: window.configs.BMapAk,
});
Vue.use(VueI18n);
const i18n = new VueI18n({
    locale: 'zh-CN',
    messages
});

Vue.use(hiPrintPlugin, '$hiPrint', false);
Vue.use(myMixin);
Vue.use(iconPicker);
Vue.use(VTreeselect);
Vue.use(FmMakingForm, {
    lang: 'zh-CN',
    i18n,
});
Vue.use(VueEditor);
Vue.use(Print);
Vue.use(VideoPlayer);
ElementUI.Dialog.props.closeOnClickModal.default = false;
ElementUI.Dialog.props.top.default = '1vh';
ElementUI.Dialog.props.modal.default = false; //关闭遮罩层
ElementUI.Drawer.props.modal.default = false; //关闭遮罩层
ElementUI.Switch.props.activeColor.default = '#13ce66'; //修改el-switch默认青色
ElementUI.Select.props.filterable.default = true; //修改el-Select默认可搜索
ElementUI.Input.props.clearable.default = true; //修改el-Select默认可搜索

Vue.use(ElementUI, {
    // size: 'small',
    size: 'mini',
});
Vue.component('tableTemplate', tableTemplate);
Vue.component('tableSetting', tableSetting);
Vue.component('treeSelect', TreeSelect);
Vue.component('vEditor', vEditor);
Vue.component('componentDialog', ComponentDialog);
Vue.component('SvgIcon', SvgIcon);
Vue.component('RemoteSelect', RemoteSelect);

// zrf
import ClipboardJS from "clipboard"; //复制插件
import getRef from '@common/components/module/getRef.js'
Vue.use(getRef, { name: 'get-ref' });
import headerTemplate from "@common/components/BaseHeader";
import vButtons from "@common/components/module/vButtons";
import vTreeEdit from "@common/components/module/vTreeEdit";
import vSelectEdit from "@common/components/module/vSelectEdit";
import vSelectTree from "@common/components/module/vSelectTree";
import vSelectBottom from "@common/components/module/vSelectBottom";
import vDownDialog from '@common/components/vxeTable/components/vDownDialog';
import vDownTreesAndListsDialog from "@common/components/vxeTable/components/vDownTreesAndListsDialog";
import vAside from "@common/components/module/vAside";
// import BaseTableFooter from "@common/components/module/BaseTableFooter";
Vue.component('headerTemplate', headerTemplate);
Vue.component('vButtons', vButtons);
Vue.component('vTreeEdit', vTreeEdit);
Vue.component('vSelectEdit', vSelectEdit);
Vue.component('vSelectTree', vSelectTree);
Vue.component('vSelectBottom', vSelectBottom);
Vue.component('vAside', vAside);
Vue.component(vDownDialog.name, vDownDialog);
Vue.component(vDownTreesAndListsDialog.name, vDownTreesAndListsDialog);
// Vue.component('BaseTableFooter', BaseTableFooter);
Vue.component(ClipboardJS);
// Vue.component(enterMixin);
import '@common/components/module/XEUtilsMixin.js'
// import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'
VXETable.setup({
    version: 0,
    zIndex: 3000,
    table: {
        autoResize: true
    }
});
Vue.use(VXETable)
Vue.prototype.$XModal = VXETable.modal
Vue.prototype.$XPrint = VXETable.print

VXETable.use(VXETablePluginElement)

// 分发器插件
// 添加 provide 属性，其中 rwDispatcherProvider 的值指向自身
// data属性中添加 rwDispatcherState 做状态管理（read or write）
// 原来表单元素的标签加一个 -dispatcher 后缀，其配置保持不变
import ElementUIRWDispatcher from 'element-ui-rw-dispatcher'
// import 'element-ui-rw-dispatcher/styles/index.scss'
Vue.use(ElementUIRWDispatcher)

import vxeTableTemplate from "@common/components/vxeTable/index.vue";
Vue.component('vxeTableTemplate', vxeTableTemplate);
import '@common/assets/css/my.css';
